Repository navigation
feat: a static service forwards paths to another server (ADR-0110) - #552
Merged
Merged
Conversation
A `kind = "static"` service takes `forward = { "/api" = "{service.api.url}" }`,
also in a profile: requests below a prefix go to the target as a reverse
proxy in front of the bundle would send them, so a single-page app that
calls its API on its own origin runs as a static build without a proxy of
its own. The longest prefix wins at a segment boundary; the path goes on
unchanged; Host is kept, X-Forwarded-* added; answers stream, WebSocket
upgrades pass; an unreachable target is a 502. `devstack check` checks
prefixes and targets (an origin over plain HTTP, a skipped container) and
warns below `requires = "0.49.0"`.
Closes #551
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A profile that turns a dev server into
kind = "static"lost the dev server's proxy config: a single-page app calling its API on its own origin (relative/api) gotindex.htmlor a 404, and a separate reverse-proxy stack was the only way out. A static service now forwards path prefixes to another server:crates/devstack-config: the key on a service and a profile's service, the shared rules inforward.rs, the checks (prefix form, target anhttp://origin withenv's placeholders, a service withinsecure_tlsand a skipped container refused),FORWARD_SINCE = "0.49.0"and its warning.devstack serve-static --forward PREFIX=URL; the daemon appends one per entry to the static service's generatedrun, so placeholders resolve per lane.staticsrv::pass: reverse proxy per request (Host kept, X-Forwarded-For/-Host/-Proto, hop-by-hop headers stripped both ways, streamed answers, WebSocket upgrades joined, 502 naming the target).docs/stack-file.md, skilldevstack-config, ADR-0110.Closes #551
Review card
Approved by the owner in the conversation on 2026-11-17, points 1–6.
forwardmaps a path prefix to a target; only forkind = "static", also in[profiles.<p>.services.<s>]; elsewhere a check error;FORWARD_SINCEwith its warning./apitakes/api,/api/…,/api?…, not/apix); path and query unchanged; a forwarded path never falls back to a file orindex.html.http://host:port, no path, no https;env's placeholders, resolved when the instance starts;checkrefuses a path,insecure_tlsand a skipped container.strip/path rewrite and TLS to the target nowHostkept,X-Forwarded-*added, hop-by-hop headers on their hop, streamed answers, WebSocket upgrades pass (as ADR-0010's proxy).Hostto the targetHostnoticedevstack tunnel) included, as in production behind a reverse proxy.Decided while building: the forward runs in the static service's own process; one connection per request, no pool; a target without a port is port 80; prefixes take letters, digits and
-._~only.Verified
cargo fmt,cargo clippy --workspace --all-targets -D warnings,cargo test --workspaceon Windows./apixserved by the app.DEVSTACK_INTEGRATION=1,lifecycle_services_only): the daemon's static site answers/infofrom the .NET API through its forward.🤖 Generated with Claude Code